import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const router = new VueRouter({

    routes: [
        // 路由重定向
        {
            path: '/',
            redirect: "/Home"
        },

        {
            name: 'goodsList',
            path: '/goodsList',
            component: () => import('@/views/Goods/GoodsList.vue')
        },
        {
            name: 'goodsDetial',
            path: "/goodsDetial/:id",
            component: () => import('@/views/Goods/GoodsDetial.vue')
        },
        {
            name: 'goodsDesc',
            path: "/goodsDesc/:id",
            component: () => import('@/views/Goods/GoodsDesc.vue')
        }, {
            name: 'goodscomment',
            path: "/goodscomment/:id",
            component: () => import('@/views/Goods/GoodsComment.vue')
        },
        {
            // 图片列表页
            name: 'imgList',
            path: '/imgList',
            component: () => import('@/views/Images/ImgList.vue')
        },
        {
            // 图片详细页
            name: 'imgdetial',
            path: '/imgdetial/:imgid',
            component: () => import('@/views/Images/ImgDetial.vue')
        },
        {
            name: 'Home',
            path: '/Home',
            component: () => import('../views/Home/Home.vue')
        },
        {
            name: "car",
            path: "/car",
            component: () => import("@/views/Car/CarList.vue")
        },
        {
            //  新闻列表页
            name: 'NewsList',
            path: '/NewsList',
            component: () => import('../views/News/NewsList.vue')
        },
        {
            //  新闻详情页
            name: 'NewsDetial',
            path: '/NewsDetial/:id',
            component: () => import('../views/News/NewsDetial.vue')
        },

    ],
    mode: 'history'
})

export default router